package com.note.simpleadmin.entity;

import javax.persistence.*;
import java.math.BigInteger;
import java.sql.Timestamp;
import java.util.Objects;

/***
 *@ClaseName:TbUser
 *
 *@Decription:
 *
 *@Author: xubingbing
 *
 *@Date:2019/1/27 0027 14:14
 */
@Entity
@Table(name = "tb_user", schema = "simpleshop", catalog = "")
public class TbUser {
    private long id;
    private String phone;
    private String pwd;
    private String salt;
    private BigInteger balance;
    private Integer vip;
    private Timestamp createTime;
    private String lastIp;
    private Timestamp lastTime;
    private String openId;
    private String registerIp;
    private Timestamp registerTime;
    private String wechatArea;
    private String wechatLogo;
    private String wechatNickname;
    private Integer wechatSex;

    @Id
    @Column(name = "id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "phone")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Basic
    @Column(name = "pwd")
    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    @Basic
    @Column(name = "salt")
    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    @Basic
    @Column(name = "balance")
    public BigInteger getBalance() {
        return balance;
    }

    public void setBalance(BigInteger balance) {
        this.balance = balance;
    }

    @Basic
    @Column(name = "vip")
    public Integer getVip() {
        return vip;
    }

    public void setVip(Integer vip) {
        this.vip = vip;
    }

    @Basic
    @Column(name = "create_time")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "last_ip")
    public String getLastIp() {
        return lastIp;
    }

    public void setLastIp(String lastIp) {
        this.lastIp = lastIp;
    }

    @Basic
    @Column(name = "last_time")
    public Timestamp getLastTime() {
        return lastTime;
    }

    public void setLastTime(Timestamp lastTime) {
        this.lastTime = lastTime;
    }

    @Basic
    @Column(name = "open_id")
    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    @Basic
    @Column(name = "register_ip")
    public String getRegisterIp() {
        return registerIp;
    }

    public void setRegisterIp(String registerIp) {
        this.registerIp = registerIp;
    }

    @Basic
    @Column(name = "register_time")
    public Timestamp getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Timestamp registerTime) {
        this.registerTime = registerTime;
    }

    @Basic
    @Column(name = "wechat_area")
    public String getWechatArea() {
        return wechatArea;
    }

    public void setWechatArea(String wechatArea) {
        this.wechatArea = wechatArea;
    }

    @Basic
    @Column(name = "wechat_logo")
    public String getWechatLogo() {
        return wechatLogo;
    }

    public void setWechatLogo(String wechatLogo) {
        this.wechatLogo = wechatLogo;
    }

    @Basic
    @Column(name = "wechat_nickname")
    public String getWechatNickname() {
        return wechatNickname;
    }

    public void setWechatNickname(String wechatNickname) {
        this.wechatNickname = wechatNickname;
    }

    @Basic
    @Column(name = "wechat_sex")
    public Integer getWechatSex() {
        return wechatSex;
    }

    public void setWechatSex(Integer wechatSex) {
        this.wechatSex = wechatSex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbUser tbUser = (TbUser) o;
        return id == tbUser.id &&
                Objects.equals(phone, tbUser.phone) &&
                Objects.equals(pwd, tbUser.pwd) &&
                Objects.equals(salt, tbUser.salt) &&
                Objects.equals(balance, tbUser.balance) &&
                Objects.equals(vip, tbUser.vip) &&
                Objects.equals(createTime, tbUser.createTime) &&
                Objects.equals(lastIp, tbUser.lastIp) &&
                Objects.equals(lastTime, tbUser.lastTime) &&
                Objects.equals(openId, tbUser.openId) &&
                Objects.equals(registerIp, tbUser.registerIp) &&
                Objects.equals(registerTime, tbUser.registerTime) &&
                Objects.equals(wechatArea, tbUser.wechatArea) &&
                Objects.equals(wechatLogo, tbUser.wechatLogo) &&
                Objects.equals(wechatNickname, tbUser.wechatNickname) &&
                Objects.equals(wechatSex, tbUser.wechatSex);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, phone, pwd, salt, balance, vip, createTime, lastIp, lastTime, openId, registerIp, registerTime, wechatArea, wechatLogo, wechatNickname, wechatSex);
    }
}
